-- GENERATED SPELL FOR [West Frostwolf Warmaster] --


function spell0_14777(pUnit, Event) --@Charge,n/a--
pUnit:FullCastSpellOnTarget(22911,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_14777', 2348, 1)
end

function spell1_14777(pUnit, Event) --@Cleave,n/a--
pUnit:FullCastSpellOnTarget(40504,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_14777', 568, 1)
end

function spell2_14777(pUnit, Event) --@Demoralizing Shout,Self--
pUnit:FullCastSpellOnTarget(23511,pUnit)
pUnit:RegisterEvent('Sorts_14777', 30269, 1)
end

function spell3_14777(pUnit, Event) --@Enrage,Self--
pUnit:FullCastSpellOnTarget(8599,pUnit)
pUnit:RegisterEvent('Sorts_14777', 586, 1)
end

function spell4_14777(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(15589,pUnit)
pUnit:RegisterEvent('Sorts_14777', 520, 1)
end

function spell5_14777(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(13736,pUnit)
pUnit:RegisterEvent('Sorts_14777', 2000, 1)
end

function Sorts_14777(pUnit, Event)
local choix_sorts_14777 = math.random(0, 5)
if choix_sorts_14777 == 0 then
pUnit:RegisterEvent('spell0_14777', 1, 1)
end
if choix_sorts_14777 == 1 then
pUnit:RegisterEvent('spell1_14777', 1, 1)
end
if choix_sorts_14777 == 2 then
pUnit:RegisterEvent('spell2_14777', 1, 1)
end
if choix_sorts_14777 == 3 then
pUnit:RegisterEvent('spell3_14777', 1, 1)
end
if choix_sorts_14777 == 4 then
pUnit:RegisterEvent('spell4_14777', 1, 1)
end
if choix_sorts_14777 == 5 then
pUnit:RegisterEvent('spell5_14777', 1, 1)
end
end

function mob14777_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_14777', math.random(1500, 3000), 1)
end

function mob14777_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob14777_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob14777_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(14777, 1, 'mob14777_Action')
RegisterUnitEvent(14777, 2, 'mob14777_Leave')
RegisterUnitEvent(14777, 3, 'mob14777_Kill')
RegisterUnitEvent(14777, 4, 'mob14777_Die')
